import Vue from 'vue'


import 'normalize.css/normalize.css' // a modern alternative to CSS resets


/*import Viewer from 'v-viewer'
import 'viewerjs/dist/viewer.css'*/

import '@/styles/index.scss' // global css

import App from './App'
import store from './store'
import router from './router'
import './icons' // icon
import './permission' // permission control
import './utils/error-log' // error log

import * as filters from './filters' // global filters
import api from '@/api/index'
import utils from './utils/utils'
import enums from './utils/enums'
import './styles/element-variables.scss'


import './utils/plugs'

Object.keys(utils).forEach(fn => {
    Vue.prototype[fn] = utils[fn];
})
Vue.prototype.enums = enums;
Vue.prototype.$api = api

localStorage.setItem('userInfoPhamacy', '{"id":26,"token":"fo9JHWsuxVWBrFGtRnqslg","statusMessage":"正常用户","createTime":1601889181000,"group":{"id":1,"name":"管理员","store":0},"name":"admin","phone":"186****7099","status":0,"loginTime":1604929368000,"num":94,"role":{"id":3,"createTime":1603192985000,"name":"测试1","menuList":[],"group":{"id":1,"name":"管理员"},"store":1}}')
/**
 * If you don't want to use mock-server
 * you want to use MockJs for mock api
 * you can execute: mockXHR()
 *
 * Currently MockJs will be used in the production environment,
 * please remove it before going online ! ! !
 */
/*if (process.env.NODE_ENV === 'production') {
    const { mockXHR } = require('../mock')
    mockXHR()
}*/
import { mockXHR }  from '../mock'
// if (process.env.NODE_ENV === 'development') {
//     mockXHR()
// }
// register global utility filters
Object.keys(filters).forEach(key => {
    Vue.filter(key, filters[key])
})

Vue.config.productionTip = false
/*全局定义的常量*/
Vue.prototype.BASE_URL = process.env.VUE_APP_BASE_API;
Vue.prototype.IMG_URL_API = process.env.VUE_APP_IMG_API;
window.globalVue = new Vue({
    el: '#app',
    router,
    store,
    render: h => h(App)
})
